function getDocs(){
	$.ajax({
		url : 'http://projects/list',
		dataType : 'json',
		success : function(data){
			var projectList = data.list || [];
			var html='';
			html+='<div class="level-first doc-level common-box">';
			html+='<ul>';
			for(var i=0; i<2; i++){	
				html+='<li><a class="doc-files" id="'+projectList[i].projectid+'">';
				html+='<span class="doc-fileIcon"></span>';
				html+='<span class="doc-name" name="'+projectList[i].projectName+'">'+projectList[i].projectName+'</span>';
				html+='</a></li>';
			}
			html+='<li><a class="doc-files" id="internal">';
			html+='<span class="doc-fileIcon"></span>';
			html+='<span class="doc-name" name="Internal Admin">Internal Admin</span>';
			html+='</a></li>';
			html+='</ul>';
			html+='</div>';
			$(".docs-box").append(html);
			//$(".level-second").before(html);
			filesClick();
			/**/
			
		}
	})
}

function file(docname,id){
	$.ajax({
		url : 'http://docs/list',
		dataType : 'json',
		success : function(data){
			var docList = data.list || [];
			var html='';
			html+='<div class="level-second doc-level common-box" id="'+id+'">';
			html+='<p>'+docname+'</p>';
			html+='<ul>';
			html+='<li><a class="doc-files" id="Photos">';
			html+='<span class="doc-fileIcon"></span>';
			html+='<span class="doc-name" name="Photos">Photos</span>';
			html+='</a></li>';
			html+='<li><a class="doc-files" id="Documents">';
			html+='<span class="doc-fileIcon"></span>';
			html+='<span class="doc-name" name="Documents">Documents</span>';
			html+='</a></li>';
			for(var i=0; i<docList.length; i++){	
				if(docList[i].docStatus == 'files'){
					html+='<li><a class="doc-files" id="'+docList[i].docId+'">';
					html+='<span class="doc-fileIcon"></span>';
				}else{
					html+='<li><a id="'+docList[i].docId+'">';
					html+='<span class="doc-paperIcon"></span>';
				}
				html+='<span class="doc-name" name="'+docList[i].docName+'">'+docList[i].docName+'</span>';
				html+='</a></li>';
			}
			html+='</ul>';
			html+='</div>';
			$(".docs-box").append(html);
			$("body").animate({scrollTop: $("#"+id).offset().top}, 1000);
			filesClick();
		}
	})
}
getDocs();


